xchg rax, rax

xchg rax, rax

  • Downloads:7072
  • Type:Epub+TxT+PDF+Mobi
  • Create Date:2021-04-10 14:52:52
  • Update Date:2025-09-06
  • Status:finish
  • Author:xorpd
  • ISBN:1502958082
  • Environment:PC/Android/iPhone/iPad/Kindle

Summary

; 0x40 assembly riddles

"xchg rax,rax" is a collection of assembly gems and riddles I found over many years of reversing and writing assembly code。 The book contains 0x40 short assembly snippets, each built to teach you one concept about assembly, math or life in general。

Download

Reviews

sine

This book is awesome so I bought the paper version even when it is available online。 Short snippets of asm programs where unlike the other books I read it does not provide anything else and it's up to the reader to figure out the meaning。 Which could be an interesting algorithm, sequence, mathematical theorem or just bit twiddling trick good to know。It was almost like reading a practical reverse engineering book, and because the most of the examples in the second half of the book are non-trivial This book is awesome so I bought the paper version even when it is available online。 Short snippets of asm programs where unlike the other books I read it does not provide anything else and it's up to the reader to figure out the meaning。 Which could be an interesting algorithm, sequence, mathematical theorem or just bit twiddling trick good to know。It was almost like reading a practical reverse engineering book, and because the most of the examples in the second half of the book are non-trivial, it's useful to compile the program or write some helper tools to understand it properly。 Not only what the program does, but more importantly, why。 。。。more

David

I normally don't review books before I fully finish reading them, but this one is going to take a long time to work through。 :-)"xchg rax,rax" contains 64 snippets of assembly code, without explanation or context。 The reader's goal is to discover the intended concept behind each。SPOILER ahead:(view spoiler)[I'm going to explain the first page (page "0x00"), just to give you the flavor of the book。 It says: xor eax,eaxlea rbx,[0]loop $ mov rdx,0and esi,0sub edi,edi push 0pop rbp What I assume this I normally don't review books before I fully finish reading them, but this one is going to take a long time to work through。 :-)"xchg rax,rax" contains 64 snippets of assembly code, without explanation or context。 The reader's goal is to discover the intended concept behind each。SPOILER ahead:(view spoiler)[I'm going to explain the first page (page "0x00"), just to give you the flavor of the book。 It says: xor eax,eaxlea rbx,[0]loop $ mov rdx,0and esi,0sub edi,edi push 0pop rbp What I assume this first page is doing is "initializing" the book by clearing registers:xor eax, eax- Clears the accumulator register (x XOR x == 0)。lea rbx,[0]- Clears the base register。 Usually, square brackets mean a dereference (meaning, get the memory contents at that address)。 But the LEA instruction doesn't work this way。 In this instruction, the brackets surround a numeric literal value zero, which is loaded into the register。loop $- Clears the counter register。 "$" gives the current value of the location counter。 This creates a tight loop that decrements the rcx on every iteration, stopping when it reaches zero。mov rdx,0- Clears the data register by setting it to zero。and esi,0- Clears the source index register (x AND 0 == 0)。sub edi,edi- Clears the destination index register (x - x == 0)。push 0pop rbp- Clears the stack base pointer by pushing zero onto the stack and popping it back off into the register。(hide spoiler)] 。。。more